package com.whminwei.edu.api.dc.dto.fspn.other;

import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.*;

import java.util.Date;
import java.util.List;

/**
 * @author zhangjq
 * @since 2024-10-11
 */
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
@JsonInclude(JsonInclude.Include.NON_NULL)
public class DcItbUseFspn {

    private List<DcInSchItbUse> inSchItbUseList;

    private List<DcOutSchItbUse> outSchItbUseList;

    private List<DcOtherItbUse> otherItbUseList;

    private List<String> deleted;

    @Data
    @Builder
    @AllArgsConstructor
    @NoArgsConstructor
    @JsonInclude(JsonInclude.Include.NON_NULL)
    public static class DcItbUse {
        private String id;
        /**
         * 校内实训基地ID
         */
        private String itbId;
        /**
         * 学年
         */
        private String year;
        /**
         * 学期
         */
        private String term;
        /**
         * 课时
         */
        private int hour;
    }

    @Data
    @AllArgsConstructor
    @NoArgsConstructor
    @JsonInclude(JsonInclude.Include.NON_NULL)
    @EqualsAndHashCode(callSuper = true)
    public static class DcInSchItbUse extends DcItbUse {
        /**
         * 实践项目ID
         */
        private String practiceId;
        /**
         * 实践项目名称
         */
        private String projectName;
        /**
         * 班级ID
         */
        private String classeId;
        /**
         * 课程ID
         */
        private String courseId;
        /**
         * 指导老师
         */
        private List<String> guideTchIds;
        /**
         * 任课老师
         */
        private List<String> teachTchIds;

        public DcInSchItbUse(DcItbUse use) {
            this.setId(use.getId());
            this.setItbId(use.getItbId());
            this.setYear(use.getYear());
            this.setTerm(use.getTerm());
            this.setHour(use.getHour());
        }
    }

    @Data
    @AllArgsConstructor
    @NoArgsConstructor
    @JsonInclude(JsonInclude.Include.NON_NULL)
    @EqualsAndHashCode(callSuper = true)
    public static class DcOutSchItbUse extends DcItbUse {
        /**
         * 参与学校名称
         */
        private String outSchoolName;
        /**
         * 参与学校类型
         */
        private String outSchoolType;
        /**
         * 开始时间
         */
        private Date startDate;
        /**
         * 结束时间
         */
        private Date endDate;
        /**
         * 参与学生人数
         */
        private int peopleNum;

        public DcOutSchItbUse(DcItbUse use) {
            this.setId(use.getId());
            this.setItbId(use.getItbId());
            this.setYear(use.getYear());
            this.setTerm(use.getTerm());
            this.setHour(use.getHour());
        }
    }

    @Data
    @AllArgsConstructor
    @NoArgsConstructor
    @JsonInclude(JsonInclude.Include.NON_NULL)
    @EqualsAndHashCode(callSuper = true)
    public static class DcOtherItbUse extends DcItbUse {
        /**
         * 活动名称
         */
        private String otherBaseName;
        /**
         * 活动类型
         */
        private String otherBaseType;
        /**
         * 开始时间
         */
        private Date startDate;
        /**
         * 结束时间
         */
        private Date endDate;
        /**
         * 参与人数
         */
        private int peopleNum;

        public DcOtherItbUse(DcItbUse use) {
            this.setId(use.getId());
            this.setItbId(use.getItbId());
            this.setYear(use.getYear());
            this.setTerm(use.getTerm());
            this.setHour(use.getHour());
        }
    }
}
